#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from dragon.selector import Selector
from dragon.page import DraPage

class PersonalSe:
        shareButton=Selector('svg.share','分享按钮')
        expireTime=Selector('div.end-time','到期时间')
        # 续费管理
        renewButton=Selector('text=续费管理','续费管理按钮')
        buyButton=Selector('div.buy-btn>div','立即购买按钮')
        payButton=Selector('div.footer-buy-btn','立即支付按钮')
        lowPrice = Selector('span.fs24', '最低价格')
        price=Selector('div.strategy-price','价格')
        selectedMonthOption=Selector('div.buy-item.cp.active','已选中月数选项')
        monthOption=Selector('div.buy-item.cp','月数选项')
        month=Selector('div.month','月数')
        estimateExpireTime=Selector('div.date.date-num','预计到期时间')
        lklPrice=Selector('span.amt','拉卡拉价格')

        # 我的自选
        subscribeButton=Selector('.ml10','我的自选按钮')
        # 我的订单
        orderButton=Selector('text=我的订单','我的订单按钮')
        orderBlock=Selector('li.infinite-list-item','订单块')
        copyButton=Selector('span.copy-btn','复制按钮')
        tacticName=Selector('span.order-name','战法名称')
        copyAlert=Selector('div.el-message.el-message--success','复制订单号提示')
        # 修改手机号
        modifyPhoneButton=Selector('text=更改/绑定手机号','修改手机号按钮')
        bindedPhone=Selector('div.phone-box>div','已绑定的手机号')

        # 联系客服
        serviceButton=Selector('text=联系客服','联系客服按钮')
        # 意见反馈
        feedbackButton=Selector('text=意见反馈','意见反馈按钮')
        textInput=Selector('textarea.el-textarea__inner','问题描述输入框')
        uploadInput=Selector('input.el-upload__input','文件上传按钮')
        onlineServiceButton=Selector('text=在线客服','在线客服按钮')
        feedbackSubmitButton=Selector('div.footer-btn.cp','提交按钮')
        feedbackSubmitAlert=Selector('div.el-message','提交提示')
        uploadedImg=Selector('div.img-item','已上传的图片')
        # 退出登录
        quitButton=Selector('text=退出登录','退出登录按钮')
        quitCancelButton=Selector('div.cancel','取消按钮')
        quitConfirmButton=Selector('div.confirm>div:nth-child(2)','确认退出按钮')
        
class PersonalPage:
    def __init__(self, draPage: DraPage):
        self.draPage=draPage
        self.shareButton = draPage.locator(PersonalSe.shareButton)
        self.expireTime = draPage.locator(PersonalSe.expireTime)
        self.renewButton = draPage.locator(PersonalSe.renewButton)
        self.buyButton = draPage.locator(PersonalSe.buyButton)
        self.payButton = draPage.locator(PersonalSe.payButton)
        self.lowPrice = draPage.locator(PersonalSe.lowPrice)
        self.price = draPage.locator(PersonalSe.price)
        self.selectedMonthOption = draPage.locator(PersonalSe.selectedMonthOption)
        self.monthOption = draPage.locator(PersonalSe.monthOption)
        self.month = draPage.locator(PersonalSe.month)
        self.estimateExpireTime = draPage.locator(PersonalSe.estimateExpireTime)
        self.lklPrice = draPage.locator(PersonalSe.lklPrice)
        self.subscribeButton = draPage.locator(PersonalSe.subscribeButton)
        self.orderButton = draPage.locator(PersonalSe.orderButton)
        self.orderBlock = draPage.locator(PersonalSe.orderBlock)
        self.copyButton = draPage.locator(PersonalSe.copyButton)
        self.tacticName = draPage.locator(PersonalSe.tacticName)
        self.copyAlert = draPage.locator(PersonalSe.copyAlert)
        self.modifyPhoneButton = draPage.locator(PersonalSe.modifyPhoneButton)
        self.bindedPhone = draPage.locator(PersonalSe.bindedPhone)
        self.serviceButton = draPage.locator(PersonalSe.serviceButton)
        self.feedbackButton = draPage.locator(PersonalSe.feedbackButton)
        self.textInput = draPage.locator(PersonalSe.textInput)
        self.uploadInput = draPage.locator(PersonalSe.uploadInput)
        self.onlineServiceButton = draPage.locator(PersonalSe.onlineServiceButton)
        self.feedbackSubmitButton = draPage.locator(PersonalSe.feedbackSubmitButton)
        self.feedbackSubmitAlert = draPage.locator(PersonalSe.feedbackSubmitAlert)
        self.uploadedImg = draPage.locator(PersonalSe.uploadedImg)
        self.quitButton = draPage.locator(PersonalSe.quitButton)
        self.quitCancelButton = draPage.locator(PersonalSe.quitCancelButton)
        self.quitConfirmButton = draPage.locator(PersonalSe.quitConfirmButton)